/*
 *  sl.c
 *
 *  (C) 2011 Harry Wei
 */

/*
 * This file is for the sequence list
 * about linear list. It also includes
 * some operations, like insert, delete,
 * etc. 
 */

#include <stdio.h>
#include <stdlib.h>

#include "sl.h"

int main(void)
{
	int i = 0;
	int num = 0;
	int *temp = NULL;
	struct seq_list *list = NULL;

	srand(time(NULL));
	list = (struct seq_list *)malloc(sizeof(struct seq_list));
	if (NULL == list) {
		printf("Allocating error!\n");
		return 1;
	}
	while (MAX > i) {
		list->elem[i] = rand() % 11;
		list->last = i;
		i = i + 1;
	}
	i = rand() % 10;
	if (!locate_seq(list, temp, &i)) {
		printf("Get the number!\n");
	} 
	i = rand() % 10;
	if (!locate_val(list, &num, &i)) {
		printf("Get the value!\n");
	}
	return 0;
}
